<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Purchase Order</title>
</head>

<h:body>

	<ui:composition template="/WEB-INF/templates/1000_layout.xhtml">
		<ui:param name="menuPurchaseOrderClass" value="selected" />

		<ui:define name="content">
			<br />
			<p:commandLink
				rendered="#{empty purchaseOrderBean.purchaseRequisition}"
				value="Click here to select purchase requisition..."
				action="/pr/main"></p:commandLink>

			<p:fieldset id="fsMain" legend="Purchase Requisition"
				rendered="#{not empty purchaseOrderBean.purchaseRequisition}">
				<ui:include
					src="/WEB-INF/templates/entity/purchaseRequisition.readonly.xhtml">
					<ui:param name="bean"
						value="#{purchaseOrderBean.purchaseRequisition}" />
				</ui:include>
			</p:fieldset>
			<br />
			<p:fieldset id="fsOpen" legend="Open Request(s)"
				rendered="#{not empty purchaseOrderBean.purchaseRequisition}">
				<h:form id="poReqForm">
				<ui:include
					src="/WEB-INF/templates/entity/purchaseOrder.requests.table.xhtml">
					<ui:param name="backingBean" value="#{dtPurchaseOrderRequestView}" />
				</ui:include>
				</h:form>

			</p:fieldset>
			<h:form id="poReqDlgForm">
				<ui:include
					src="/WEB-INF/templates/entity/purchaseOrder.requests.table.dialog.xhtml">
					<ui:param name="backingBean" value="#{dtPurchaseOrderRequestView}" />
					<ui:param name="dialogWidgetName" value="poReqDialog" />
				</ui:include>
			</h:form>

			<br />
			<p:fieldset id="fsPO" legend="Purchase Order(s)"
				rendered="#{not empty purchaseOrderBean.purchaseRequisition}">
				
				<ui:include src="/WEB-INF/templates/entity/purchaseOrder.accordion.xhtml" />
				
			</p:fieldset>
			
			<ui:remove>
			<ui:include src="/WEB-INF/templates/entity/purchaseOrder.accordion.dialog.xhtml" />
			</ui:remove>

		</ui:define>
	</ui:composition>

</h:body>
</html>